-----------------------------Tai khoan the--------------------
-------------Thong tin tai khoan the--------------
if exists (select name from sysobjects where name like 'Proc_TaiKhoanThe_GetById')
	drop procedure Proc_TaiKhoanThe_GetById
go

create PROC Proc_TaiKhoanThe_GetById (@maTKT int )
as
	select * from TaiKhoanThe
	where MaTaiKhoanThe = @maTKT
go

Exec Proc_TaiKhoanThe_GetById 1
go


-------------------- -----------------------------
------------- Update tai khoan the-------------------

if exists (select name from sysobjects where name like 'Proc_TaiKhoanThe_Update')
	drop procedure Proc_TaiKhoanThe_Update
go

create PROC Proc_TaiKhoanThe_Update (@maTKThe int, @maTKChinh int,@soDu float ,@LSuat float , @MaLoaiThe int ,@LockFlg int 
		, @DelFlg int , @MaLoaiTien int, @MaLoaiTK int )
as

		Update TaiKhoanThe 
		set MaTkChinh= @maTKChinh , SoDu= @soDu , LaiSuat= @LSuat,
			MaLoaiThe= @MaLoaiThe ,LockFlg= @LockFlg , DelFlg=@DelFlg, MaLoaiTien = @MaLoaiTien ,MaLoaiTK= @MaLoaiTK
		where MaTaiKhoanThe= @maTKThe 
		

go

-------------------------------------
------------- tim tai khoan chinh the ma---------------------
if exists (select name from sysobjects where name like 'Proc_TaiKhoanThe_GetByMaTaiKhoanChinh')
	drop procedure Proc_TaiKhoanThe_GetByMaTaiKhoanChinh
go

create PROC Proc_TaiKhoanThe_GetByMaTaiKhoanChinh (@maTK int )
as
	select * from TaiKhoanThe
	where MaTkChinh = @maTK
go

Exec Proc_TaiKhoanThe_GetByMaTaiKhoanChinh 1
go